﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using TextEditor.TextDocument.Document;

namespace TextEditor.TextDocument.Control
{
    public partial class frmFindReplace : Form
    {
        public frmFindReplace()
        {
            InitializeComponent();
        }

        public ZYTextDocument document = null;
        public frmFindReplace(ZYTextDocument document)
        {
            InitializeComponent();
            this.document = document;
        }


        private void button1_Click(object sender, EventArgs e)
        {
            this.document._Find(this.textBox1.Text.Trim());
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.document._Replace(this.textBox1.Text.Trim(), this.textBox2.Text.Trim());
        }

        private void frmFindReplace_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = true;
            this.Hide();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.Hide();
        }
    }
}
